/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package agenda;

import agenda.entityes.AgeEntry;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Scanner;
import javax.swing.text.StyledEditorKit;

/**
 *
 * @author emanuele
 */
@SuppressWarnings("serial")
public class DettailDiag extends javax.swing.JDialog {

   /**
    * Creates new form DettailDiag
    *
    * @param parent
    * @param modal
    * @param entry
    */
   public DettailDiag(java.awt.Frame parent, boolean modal, AgeEntry entry) {
      super(parent, modal);
      initComponents();

      /* aggiungi un mouse listner per chiudere la finestra al doppio click */
      addMouseListener(new MouseAdapter() {

         @Override
         public void mouseClicked(MouseEvent e) {
            /* se sono stati eseguiti due o più click rapidi, chiudi la finestra. */
            if (e.getClickCount() >= 2) {
               dispose();
            }
         }
      });

      Scanner gni = new Scanner(System.in);

      pack();
   }

   /**
    * This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The
    * content of this method is always regenerated by the Form Editor.
    */
   @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane1 = new javax.swing.JScrollPane();
        jEditorPane1 = new javax.swing.JEditorPane();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        getContentPane().setLayout(new javax.swing.BoxLayout(getContentPane(), javax.swing.BoxLayout.LINE_AXIS));

        jEditorPane1.setContentType("text\n");
        jEditorPane1.setEditable(false);
        jEditorPane1.setEditorKit(new StyledEditorKit());
        jScrollPane1.setViewportView(jEditorPane1);

        getContentPane().add(jScrollPane1);

        pack();
    }// </editor-fold>//GEN-END:initComponents
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JEditorPane jEditorPane1;
    private javax.swing.JScrollPane jScrollPane1;
    // End of variables declaration//GEN-END:variables
}
